<?php
/**
 * Created by PhpStorm.
 * User: lee
 * Date: 2018/1/9
 * Time: 下午3:39
 */

namespace Biz\model\tiles;


class TopupOptions extends \Doraemon\pockets\datebase\BaseDbModel
{
    const _CONFIG_FILE_ = 'db_tiles';

    const _CONFIG_SELECT_ = 'db_tiles';

    const _DATABASE_ = 'tiles';

    const _TABLE_NAME = 'topup_options';

    const STATUS_NORMAL = 1;

    public static function getTopupOptions()
    {
        return self::select("*", [
            'option_status' => self::STATUS_NORMAL,
            'ORDER'  => ['price' => 'ASC']
        ]);
    }

    public static function getOptionByAppleProductId($appleProductId)
    {
        return self::get('*', [
            'product_id' => $appleProductId,
            'option_status'  => self::STATUS_NORMAL,
        ]);
    }

}